package cn.controller;

import cn.entity.ExamineCondition;
import cn.entity.Result;
import cn.service.ExamineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

@RestController
@RequestMapping("/examine")
public class ExamineController {

    @Autowired
    ExamineService examineService;

    @RequestMapping("index")
    public ModelAndView examine(){
        return new ModelAndView("/examine/index");
    }
    @RequestMapping("/select/{pageNum}/{pageSize}")
    public Result select(@PathVariable("pageNum")int pageNum, @PathVariable("pageSize")int pageSize, @RequestBody ExamineCondition condition){
        return new Result(true,"成功", examineService.listPage(pageNum,pageSize,condition));
    }
}
